package cn.iocoder.yudao.module.alipay.dal.mysql.infothirdaliapp;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.alipay.dal.dataobject.infothirdaliapp.InfoThirdAliAppDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.alipay.controller.admin.infothirdaliapp.vo.*;

/**
 * 第三方应用信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface InfoThirdAliAppMapper extends BaseMapperX<InfoThirdAliAppDO> {

    default PageResult<InfoThirdAliAppDO> selectPage(InfoThirdAliAppPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InfoThirdAliAppDO>()
                .eqIfPresent(InfoThirdAliAppDO::getAppId, reqVO.getAppId())
                .likeIfPresent(InfoThirdAliAppDO::getAppName, reqVO.getAppName())
                .betweenIfPresent(InfoThirdAliAppDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InfoThirdAliAppDO::getId));
    }

    default List<InfoThirdAliAppDO> selectList(InfoThirdAliAppExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<InfoThirdAliAppDO>()
                .eqIfPresent(InfoThirdAliAppDO::getAppId, reqVO.getAppId())
                .likeIfPresent(InfoThirdAliAppDO::getAppName, reqVO.getAppName())
                .betweenIfPresent(InfoThirdAliAppDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InfoThirdAliAppDO::getId));
    }

    default InfoThirdAliAppDO selectByAppId(Long appId){
        return selectOne(new LambdaQueryWrapperX<InfoThirdAliAppDO>().eqIfPresent(InfoThirdAliAppDO::getAppId, appId));
    };
}
